/*
*
* SysRoleMapper.java
* Copyright(C) 2017-2020 fendo公司
* @date 2018-07-02
*/
package com.mass.core.sys.role.dao;

import com.mass.core.sys.menu.model.SysMenu;
import com.mass.core.sys.role.model.SysRole;
import com.mass.core.sys.role.model.SysRoleExample;

import java.util.List;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
@Mapper
public interface SysRoleMapper {
	
	//根据用户查询角色
	List<SysRole> findRoleByUserId(@Param("userId") Long userId);

	/**
	 * 查询所有权限
	 * @return
	 */
	List<SysMenu> findAutorityAll(@Param("roleId") Long roleId,@Param("parentId") Long parentId);
	
    /**
     *
     * @mbg.generated
     */
    long countByExample(SysRoleExample example);

    /**
     *
     * @mbg.generated
     */
    int deleteByExample(SysRoleExample example);

    /**
     *
     * @mbg.generated
     */
    int deleteByPrimaryKey(Long id);

    /**
     *
     * @mbg.generated
     */
    int insert(SysRole record);

    /**
     *
     * @mbg.generated
     */
    int insertSelective(SysRole record);

    /**
     *
     * @mbg.generated
     */
    List<SysRole> selectByExample(SysRoleExample example);

    /**
     *
     * @mbg.generated
     */
    SysRole selectByPrimaryKey(Long id);

    /**
     *
     * @mbg.generated
     */
    int updateByExampleSelective(@Param("record") SysRole record, @Param("example") SysRoleExample example);

    /**
     *
     * @mbg.generated
     */
    int updateByExample(@Param("record") SysRole record, @Param("example") SysRoleExample example);

    /**
     *
     * @mbg.generated
     */
    int updateByPrimaryKeySelective(SysRole record);

    /**
     *
     * @mbg.generated
     */
    int updateByPrimaryKey(SysRole record);
}